﻿<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>意见内容列表 - 后台管理 - smoothly</title>
    <!-- 引入网站头部 -->
    <div th:replace="~{include/all_include::title}"/>

</head>
<body>
<!-- body的标题栏 -->
<nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i> 首页
    <span class="c-gray en">&gt;</span> 意见管理
    <span class="c-gray en">&gt;</span> 意见内容管理
    <a class="btn btn-success radius r btn-refresh" style="line-height:1.6em;margin-top:3px"
       href="javascript:location.replace(location.href);" title="刷新">
        <i class="Hui-iconfont">&#xe68f;</i>
    </a>
</nav>
<!-- 内容 -->
<div class="page-container">
    <form th:action="@{/back/opinion/opinionDescList}" method="post">
        <input type="hidden" name="parentId" th:value="${parentId}">
        <div class="text-c">
            关键字:
            <input type="text" class="input-text" style="width:250px" placeholder="输入关键字" id="keyword" name="keyword" th:value="${keyword}">
            意见类型:
            <span class="select-box inline">
                <select name="typeId" class="select">
                    <option value="">请选择</option>
                    <option th:selected="${typeId == (oneTemp.id + '')}"
                            th:each="oneTemp : ${opinionResponse.data.list}"
                            th:value="${oneTemp.id}" th:text="${oneTemp.name}"></option>
                </select>
            </span>
            分类:
            <span class="select-box inline">
                <select name="opType" class="select">
                    <option value="">请选择</option>
                    <option value="0" th:selected="${opType == '0'}">普通</option>
                    <option value="1" th:selected="${opType == '1'}">热门</option>
                    <option value="2" th:selected="${opType == '2'}">精华</option>
                </select>
            </span>
            解决状态:
            <span class="select-box inline">
                <select name="resolveStatus" class="select">
                    <option value="">请选择</option>
                    <option value="1" th:selected="${resolveStatus == '1'}">解决</option>
                    <option value="0" th:selected="${resolveStatus == '0'}">未解决</option>
                </select>
            </span>
            状态:
            <span class="select-box inline">
                <select name="status" class="select">
                    <option value="">请选择</option>
                    <option value="1" th:selected="${status == '1'}">已发布</option>
                    <option value="0" th:selected="${status == '0'}">草稿</option>
                </select>
            </span>
            日期范围：
            <input type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" id="datemin"
                   readonly name="st"
                   th:value="${st}"
                   class="input-text Wdate" style="width:170px;">
            -
            <input type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" id="datemax"
                   readonly name="ed"
                   th:value="${ed}"
                   class="input-text Wdate" style="width:170px;">
            <button type="submit" class="btn btn-success radius" id="" name="">
                <i class="Hui-iconfont">&#xe665;</i>
                搜索
            </button>
        </div>
    </form>
    <div class="cl pd-5 bg-1 bk-gray mt-20">
        <span class="r">共有数据：<strong th:text="${response?.data?.pageInfoUtil?.totalRecord}"></strong>条</span>
    </div>
    <div class="mt-20">
        <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper no-footer">
            <table class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
                <thead>
                <tr class="text-c">
                    <th width="110">Id</th>
                    <th width="80">意见类型</th>
                    <th width="80">标题</th>
                    <th width="50">状态</th>
                    <th width="50">分类</th>
                    <th width="50">解决状态</th>
                    <th width="110">解决时间</th>
                    <th width="50">响应时间</th>
                    <th width="50">创建人</th>
                    <th width="110">创建时间</th>
                    <th width="110">更新时间</th>
                    <th width="110">发布时间</th>
                    <th width="50">操作</th>
                </tr>
                </thead>
                <tbody>
                <tr class="text-c" th:each="one : ${response?.data?.list}">
                    <td th:text="${one.id}"></td>
                    <td>
                        <a href="javascript:;" th:title="'查看意见内容详情-'+${one.name}" th:data-title="'查看意见类型详情-'+${one?.type?.name}"
                           th:data-href="@{/back/opinion/opinionTypeUpdate(id=${one?.typeId})}"
                           onclick="Hui_admin_tab(this)"
                           th:text="${#strings.abbreviate(one?.type?.name,10)}" class="href_info"></a>
                    </td>
                    <td>
                        <a href="javascript:;" th:title="'查看意见内容详情-'+${one.name}" th:data-title="'查看意见内容详情-'+${one.name}"
                           th:data-href="@{/back/opinion/opinionDescUpdate(id=${one?.id})}"
                           onclick="Hui_admin_tab(this)"
                           th:text="${#strings.abbreviate(one.name,10)}" class="href_info"></a>
                    </td>
                    <td class="td-status">
                        <span class="label label-success radius" th:text="${one.statusStr}"></span>
                    </td>
                    <td class="td-status">
                        <span class="label label-success radius" th:text="${one.opTypeStr}"></span>
                    </td>
                    <td class="td-status">
                        <span class="label label-success radius" th:text="${one.resolveStatusStr}"></span>
                    </td>
                    <td th:text="${one.resolveTime}"></td>
                    <td th:text="${one.reponseTime}"></td>
                    <td th:text="${one?.createUsers?.nickName}"></td>
                    <td th:text="${one.createTime}"></td>
                    <td th:text="${one.updateTime}"></td>
                    <td th:text="${one.pubTime}"></td>
                    <td class="td-manage">
                        <a th:if="${one.parentId == 0}"href="javascript:;" th:title="'回复列表-'+${one.name}" th:data-title="'回复列表-'+${one?.type?.name}"
                           th:data-href="@{/back/opinion/opinionDescList(parentId=${one?.id})}"
                           onclick="Hui_admin_tab(this)"
                           class="href_info"><i class="Hui-iconfont">&#xe667;</i></a>
                        <a th:if="${one.parentId == 0}"title="解决" href="javascript:;" th:onclick="page_edit('解决问题','back/opinion/opinionDescInsert?operType=update',[[${one.id}]])"
                           class="ml-5" style="text-decoration:none">
                            <i class="Hui-iconfont">&#xe614;</i>
                        </a>
                        <a th:if="${one.parentId != 0}"href="javascript:;" th:title="'编辑-'+${one.name}" th:data-title="'编辑-'+${one?.type?.name}"
                           th:data-href="@{/back/opinion/opinionDescUpdate?operType=update(id=${one?.id})}"
                           onclick="Hui_admin_tab(this)"
                           class="href_info"><i class="Hui-iconfont">&#xe6df;</i></a>
                    </td>
                </tr>
                </tbody>
            </table>

            <form th:action="@{/back/opinion/opinionDescList}" method="post" id="pageForm">
                <input type="hidden" name="parentId" th:value="${parentId}">
                <input type="hidden" name="keyword" th:value="${keyword}">
                <input type="hidden" name="status" th:value="${status}">
                <input type="hidden" name="opType" th:value="${opType}">
                <input type="hidden" name="st" th:value="${st}">
                <input type="hidden" name="ed" th:value="${ed}">
                <input type="hidden" name="typeId" th:value="${typeId}">
                <input type="hidden" name="opType" th:value="${opType}">
                <input type="hidden" name="resolveStatus" th:value="${resolveStatus}">

                <div class="dataTables_info" id="DataTables_Table_0_info"
                     role="status" aria-live="polite">
                    共<span th:text="${response?.data?.pageInfoUtil?.totalRecord}"></span>条,共<span th:text="${response?.data?.pageInfoUtil?.totalPage}"></span>页
                </div>
                <div class="dataTables_paginate paging_simple_numbers"
                     id="DataTables_Table_0_paginate">
                    <a class="paginate_button previous disabled"
                       aria-controls="DataTables_Table_0" data-dt-idx="0" tabindex="0"
                       th:onclick="return pageFormSubmit('pageForm','current','1','size',[[${response?.data?.pageInfoUtil?.pageSize}]])"
                       id="DataTables_Table_0_previous">
                        首页
                    </a>
                    <a class="paginate_button previous disabled"
                       aria-controls="DataTables_Table_0" data-dt-idx="0" tabindex="0"
                       th:onclick="return pageFormSubmit('pageForm', 'current', '[[${response?.data?.pageInfoUtil?.prePage}]]', 'size',[[${response?.data?.pageInfoUtil?.pageSize}]])"
                       id="DataTables_Table_0_previous">
                        上一页
                    </a>
                    <a class="paginate_button next disabled"
                       aria-controls="DataTables_Table_0" data-dt-idx="2" tabindex="0"
                       th:onclick="return pageFormSubmit('pageForm', 'current', '[[${response?.data?.pageInfoUtil?.nextPage}]]', 'size',[[${response?.data?.pageInfoUtil?.pageSize}]])"
                       id="DataTables_Table_0_next">
                        下一页
                    </a>
                    <a class="paginate_button next disabled"
                       aria-controls="DataTables_Table_0" data-dt-idx="2" tabindex="0"
                       th:onclick="return pageFormSubmit('pageForm', 'current', '[[${response?.data?.pageInfoUtil?.totalPage}]]', 'size',[[${response?.data?.pageInfoUtil?.pageSize}]])"
                       id="DataTables_Table_0_next">
                        尾页
                    </a>
                    第<input type="text" class="paginate_button" id="current" name="currentPage" th:value="${response?.data?.pageInfoUtil?.currentPage}" size="5" maxlength="5">页
                    每页<input type="text" class="paginate_button" id="size" name="pageSize" th:value="${response?.data?.pageInfoUtil?.pageSize}" size="5" maxlength="5">条
                    <input type="submit" value="GO" class="paginate_button">
                </div>
            </form>
        </div>
    </div>
</div>
<!-- 引入公共的头部 -->
<div th:replace="~{include/all_include::footer}"></div>
<script type="text/javascript" th:inline="javascript">
    /* js中获取的项目根路径 */
    var rootPath = [[@{/}]];
        $(function () {
            $('.table-sort').dataTable({
                "aaSorting": [],//默认第几个排序
                "bStateSave": true,//状态保存
                "paging" : false,
                "info":false,
                "aoColumnDefs": [
                    //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
                    {"orderable": false, "aTargets": [0, 8, 9]}// 制定列不参与排序
                ]
            });
        });
    /*用户-添加*/
    function page_add(title, url, w, h) {
        var index = layer.open({
            type: 2,
            title: title,
            content: rootPath + url
        });
        layer.full(index);
    }

    /*用户-查看*/
    function page_show(title, url, id, w, h) {
        layer_show(title, url, w, h);
    }
    /*用户-编辑*/
    function page_edit(title, url, id) {
        var index = layer.open({
            type: 2,
            title: title,
            content: rootPath + url + "&parentId=" + id
        });
        layer.full(index);
        return false;
    }

    /*
        批量操作切换
    */
    function batchSwitch(selId)
    {
        var selVal = $("#" + selId).val();
        /* 所有的选择信息都隐藏掉 */
        $(".selectInfo").hide();

        if('updateStatus' == selVal)
        {
            $("#" + selVal).show();
        }
    }
</script>
</body>
</html>